//! # 框架模块测试
//! 
//! 本模块包含对框架功能的测试用例。

#[cfg(test)]
mod tests {
    use super::*;
    use crate::framework::core::RustCloudFramework;
    use crate::framework::core::FrameworkState;
    use crate::builder::simple::RustCloudBuilder;

    #[tokio::test]
    async fn test_framework_creation() {
        let framework = RustCloudBuilder::new("test-service")
            .with_port(8080)
            .build()
            .await
            .unwrap();

        assert_eq!(framework.get_service_instance().name, "test-service");
        assert_eq!(framework.get_service_instance().port, 8080);
    }

    #[tokio::test]
    async fn test_framework_state() {
        let framework = RustCloudBuilder::new("test-service")
            .build()
            .await
            .unwrap();

        assert_eq!(framework.get_state().await, FrameworkState::Uninitialized);
    }

    #[tokio::test]
    async fn test_health_check() {
        let framework = RustCloudBuilder::new("test-service")
            .build()
            .await
            .unwrap();

        let health = framework.health_check().await.unwrap();
        assert_eq!(health.status, crate::framework::health::HealthLevel::Healthy);
    }
}